﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace StudentManage
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string sql = "select * from subject";
            DataTable tb = XL_BANG.Doc(sql);

            foreach (DataRow item in tb.Rows)
            {
                sql = "update subject set name = '" + item["name"].ToString().Trim() + "' where id = " + item["id"];
                XL_BANG.Update(sql);
                
            }
            MessageBox.Show("OK");
        }
    }
}
